package service

import (
	"context"
	"github.com/jinzhu/copier"

	"github.com/cloudwego/hertz/pkg/app"
	stage "stage/hertz_gen/stage"
	. "stageRpc/client"
	stageRpcModel "stageRpc/kitex_gen/stage"
)

type DeleteFloorService struct {
	RequestContext *app.RequestContext
	Context        context.Context
}

func NewDeleteFloorService(Context context.Context, RequestContext *app.RequestContext) *DeleteFloorService {
	return &DeleteFloorService{RequestContext: RequestContext, Context: Context}
}

func (h *DeleteFloorService) Run(req *stage.Param) (resp *bool, err error) {
	var param = new(stageRpcModel.Param)
	if err = copier.Copy(param, req); err != nil {
		return
	}
	r, err := StageClient.DeleteFloor(context.Background(), param)
	if err != nil {
		return
	}
	resp = &r
	return
}
